import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import '@/styles/reset.less'
// import request from './utils/http'
import componentsPlugin from '@/components'
import { directivePlugin } from '@/directives/index'

// setTimeout(() => {
//   store.commit('user/setToken', 'tokenstr')
// }, 30000)

// request('/login', 'get', { name: 'zs' }).then(res => {
//   console.log(res)
// })
// request('/login', 'Post', { name: 'zs' }).then(res => {
//   console.log(res)
// })

// createApp() -> app -> app.use(router) 插件的注册  [Vue.use]
// 链式调用
// 方法执行的返回值依旧是那个调用方法的对象
createApp(App).use(store).use(directivePlugin).use(router).use(componentsPlugin).mount('#app')
